<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

// http://erp/create/3
//Route::post('create/:id','DeptController/create');

//路由分组，需要绑定绑定域名

// 部门管理
Route::group('dept', function () {
    Route::post('add', 'DeptController/add');
    Route::get('list', 'DeptController/list');
    Route::put('update', 'DeptController/update');
    Route::delete('delete', 'DeptController/delete');
})->middleware(app\auth\middleware\Check::class);

// 角色管理
Route::group('role', function () {
    Route::post('add', 'RoleController/add');
    Route::get('list', 'RoleController/list');
    Route::put('update', 'RoleController/update');
    Route::delete('delete', 'RoleController/delete');
    Route::get('opt', 'RoleController/opt');
})->middleware(app\auth\middleware\Check::class);

// 权限管理
Route::group('right', function () {
    Route::post('add', 'RightController/add');
    Route::get('list', 'RightController/list');
    Route::put('update', 'RightController/update');
    Route::delete('delete', 'RightController/delete');
    Route::get('opt', 'RightController/opt');
})->middleware(app\auth\middleware\Check::class);

// 员工管理
Route::group('admin', function () {
    Route::post('add', 'AdminController/add')->middleware(app\auth\middleware\Check::class);
    Route::put('update', 'AdminController/update')->middleware(app\auth\middleware\Check::class);
    Route::post('login', 'AdminController/login');
    Route::get('list', 'AdminController/list')->middleware(app\auth\middleware\Check::class);
    Route::get('opt', 'AdminController/opt');
});
